package cmd

import (
	"ai-cli/handler"
	"fmt"
	"github.com/spf13/cobra"
)

var envCmd = &cobra.Command{
	Use: "setKey",
	Run: func(cmd *cobra.Command, args []string) {
		if len(args) == 0 {
			fmt.Println("key为空,使用方法:\r\naicmd setKey '你的key' ")
		} else {
			key := args[0]
			handler.SetEnvKey(key)
		}
	},
}

func init() {
	rootCmd.AddCommand(envCmd)
}
